<?php

namespace App\Console\Commands;

use App\Services\DelayQueue\DelayQueueServices;
use Illuminate\Console\Command;

class DelayQueue extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:delayQueue';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        for($i=1;$i>0;$i++){
            $data = DelayQueueServices::getInstance()->redisBlpop();
//            if($data === false){
//                echo "空";
//            }
//            echo $data[1];
            print_r($data);
            sleep(5);
        }

//        sleep(5);
//        return 0;
    }
}
